package org.mifos.boss.ui.controller;

import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.Logger;
import org.mifos.boss.domainmodel.Mobile2BossData;
import org.mifos.boss.domainmodel.MobileFileUpload;
import org.mifos.boss.service.BossReportingServiceInterface;
import org.mifos.boss.service.CustomerServiceInterface;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;


@Controller
//@RequestMapping(value = "/")
public class BossDashboardController extends AbstractController {

	static Logger logger = Logger.getLogger(BossDashboardController.class);

	@Autowired
	@Qualifier("bossReportingService")
	private BossReportingServiceInterface bossReportingService; 
	
	@Autowired
	@Qualifier("customerService")
	private CustomerServiceInterface customerService;
	
	@RequestMapping(value = "/dashboard")
	public void getAllMobile2BossData(Model model){
		
		List<Mobile2BossData> m2bList = new ArrayList<Mobile2BossData>();
		
		m2bList = customerService.getAllMobile2BossData();
		model.addAttribute("m2bList", m2bList);
		 
		//test
		for(Mobile2BossData m : m2bList){
			System.out.println(m.getDeviceId() + "   "+ m.getTransferId());
		}
	}
	

}
